package com.example.springrabbitmq.listener;

import com.example.springrabbitmq.constant.Constants;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

//@Component
public class TopicsListener {
    @RabbitListener(queues = Constants.TOPICS_QUEUE_1)
    public void queueListener1(String message) {
        System.out.println("listener1 [" + Constants.TOPICS_QUEUE_1 +"] 接收到消息: " + message);
    }

    @RabbitListener(queues = Constants.TOPICS_QUEUE_2)
    public void queueListener2(String message) {
        System.out.println("listener2 [" + Constants.TOPICS_QUEUE_2 +"] 接收到消息: " + message);
    }
}
